package com.isoft.entity;

import jakarta.xml.bind.annotation.*;
import lombok.Data;

import java.util.List;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfmeCklsEntity {
    @XmlElement(name = "META")
    private Meta meta;

    @XmlElement(name = "DFLT")
    private Dflt dflt;

    private Long msgId;
    public Long getMsgId() { return msgId; }
    public void setMsgId(Long msgId) { this.msgId = msgId; }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "SNDR")
        private String sender;
        @XmlElement(name = "RCVR")
        private String receiver;
        @XmlElement(name = "SEQN")
        private Long sequenceNumber;
        @XmlElement(name = "DDTM")
        private String dateTime;
        @XmlElement(name = "TYPE")
        private String type;
        @XmlElement(name = "STYP")
        private String subType;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dflt {
        @XmlElement(name = "FLID")
        private Long flightId;
        @XmlElement(name = "FFID")
        private String flightFileId;
        @XmlElement(name = "FIDE")
        private String flightIdentifier;
        @XmlElement(name = "FATT")
        private String flightAttribute;
        @XmlElement(name = "CKLS")
        private Ckls ckls;
        @XmlElement(name = "STATUS")
        private String status;

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Ckls {
            @XmlElement(name = "FCES")
            private String fces;
            @XmlElement(name = "FCEE")
            private String fcee;
            @XmlElement(name = "FCRS")
            private String fcrs;
            @XmlElement(name = "FCRE")
            private String fcre;
            @XmlElement(name = "MCES")
            private String mces;
            @XmlElement(name = "MCEE")
            private String mcee;
            @XmlElement(name = "MCRS")
            private String mcrs;
            @XmlElement(name = "MCRE")
            private String mcre;
            @XmlElement(name = "FCDP")
            private String fcdp;
            @XmlElement(name = "MCDP")
            private String mcdp;

            @XmlElement(name = "CNTR")
            private List<Counter> counters;

            @Data
            @XmlAccessorType(XmlAccessType.FIELD)
            public static class Counter {
                @XmlElement(name = "CKNO")
                private Integer counterNo;
                @XmlElement(name = "ID")
                private Long id;
                @XmlElement(name = "CODE")
                private String code;
                @XmlElement(name = "CKAT")
                private String counterAttribute;
                @XmlElement(name = "TYPE")
                private String type;
                @XmlElement(name = "CCAR")
                private String counterCarrier;
                @XmlElement(name = "ESTR")
                private String estimatedStartTime;
                @XmlElement(name = "EEND")
                private String estimatedEndTime;
                @XmlElement(name = "RSTR")
                private String realStartTime;
                @XmlElement(name = "REND")
                private String realEndTime;
                @XmlElement(name = "BTSC")
                private String beltSection;
            }

            public List<Counter> getCounters() {
                return counters;
            }

            public void setCounters(List<Counter> counters) {
                this.counters = counters;
            }
        }

        public Long getFlightId() {
            return flightId;
        }

        public void setFlightId(Long flightId) {
            this.flightId = flightId;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public Ckls getCkls() {
            return ckls;
        }

        public void setCkls(Ckls ckls) {
            this.ckls = ckls;
        }
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public Dflt getDflt() {
        return dflt;
    }

    public void setDflt(Dflt dflt) {
        this.dflt = dflt;
    }
}
